﻿using System;

using btmerc.API.Schemas;

namespace btmerc.API.Negotiation
{
    public class NegotiatedContract : Contract, ICloneable
    {
        public bool IsLengthDiscussed { get; set; }
        public bool IsCommandDiscussed { get; set; }
        public bool IsOverheadDiscussed { get; set; }
        public bool IsPayDiscussed { get; set; }
        public bool IsSalvageDiscussed { get; set; }
        public bool IsSupportDiscussed { get; set; }
        public bool IsTransportDiscussed { get; set; }
        public int SigningBonus { get; set; }

        public NegotiatedContract()
        {
            IsCommandDiscussed = false;
            IsOverheadDiscussed = false;
            IsSalvageDiscussed = false;
            IsSupportDiscussed = false;
            IsTransportDiscussed = false;
            SigningBonus = 0;
        }

        public NegotiatedContract(Contract contract) : this()
        {
            this.Employer = contract.Employer;
            this.ContractTerms = (ContractTerms)contract.ContractTerms.Clone();
            this.ContractType = contract.ContractType;
            this.IsCovert = contract.IsCovert;
        }

        public object Clone()
        {
            NegotiatedContract clone = new NegotiatedContract(this);
            clone.IsCommandDiscussed = this.IsCommandDiscussed;
            clone.IsLengthDiscussed = this.IsLengthDiscussed;
            clone.IsOverheadDiscussed = this.IsOverheadDiscussed;
            clone.IsPayDiscussed = this.IsPayDiscussed;
            clone.IsSalvageDiscussed = this.IsSalvageDiscussed;
            clone.IsSupportDiscussed = this.IsSupportDiscussed;
            clone.IsTransportDiscussed = this.IsTransportDiscussed;
            clone.SigningBonus = this.SigningBonus;
            return clone;
        }
    }
}
